kind: Deployment
apiVersion: apps/v1
metadata:
  name: fluentbit-operator
  namespace: kubesphere-logging-system
  labels:
    app.kubernetes.io/component: operator
    app.kubernetes.io/name: fluentbit-operator
spec:
  selector:
    matchLabels:
      app.kubernetes.io/component: operator
      app.kubernetes.io/name: fluentbit-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/component: operator
        app.kubernetes.io/name: fluentbit-operator
    spec:
      volumes:
      - name: env
        emptyDir: {}
      - name: dockersock
        hostPath:
          path: /var/run/docker.sock
      initContainers:
      - name: setenv
        image: {{ docker_repo }}:{{ docker_tag }}
        command:
        - /bin/sh
        - '-c'
        - set -ex;
          echo DOCKER_ROOT_DIR=$(docker info -f {{'{{.DockerRootDir}}'}}) > /fluentbit-operator/fluent-bit.env
        volumeMounts:
        - name: env
          mountPath: /fluentbit-operator
        - name: dockersock
          readOnly: true
          mountPath: /var/run/docker.sock
      containers:
      - name: fluentbit-operator
        image: {{ fluentbit_operator_repo }}:{{ fluentbit_operator_tag }}
        resources:
          limits:
            cpu: 100m
            memory: 30Mi
          requests:
            cpu: 100m
            memory: 20Mi
        volumeMounts:
        - name: env
          mountPath: /fluentbit-operator
      serviceAccountName: fluentbit-operator